package com.example.day14_service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class MyService2 extends Service {
    public MyService2() {
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.d("sss", "onBind: 服务被绑定了");
        return new MyBinder();
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.d("sss", "onUnbind: 服务解除绑定了");
        return super.onUnbind(intent);
    }

    class MyBinder extends Binder{
        public void play(){
            Log.d("sss", "play: 点击了播放按钮");
        }
        public void pre(){
            Log.d("sss", "pre: 点击了上一首按钮");
        }
        public void next(){
            Log.d("sss", "next: 点击了下一首按钮");
        }
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Log.d("sss", "onCreate: 被创建");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d("sss", "onDestroy: 被销毁");
    }
}